package org.leiyang.common.util;

import java.time.Instant;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;

/**
 * 日期工具类
 */
public class TimeUtils {

    /**
     * 格式化毫秒时间戳
     */
    public static String formatMills(Long timestampMillis, DateTimeFormatter formatter) {
        return ZonedDateTime.ofInstant(Instant.ofEpochMilli(timestampMillis), ZoneId.systemDefault())
                .format(formatter);
    }

}
